package com.ruoyi.manger.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manger.mapper.NewsNoticeMapper;
import com.ruoyi.manger.domain.NewsNotice;
import com.ruoyi.manger.service.INewsNoticeService;

/**
 * 政务公开新闻Service业务层处理
 * 
 * @author ssh
 * @date 2024-12-15
 */
@Service
public class NewsNoticeServiceImpl implements INewsNoticeService 
{
    @Autowired
    private NewsNoticeMapper newsNoticeMapper;

    /**
     * 查询政务公开新闻
     * 
     * @param id 政务公开新闻主键
     * @return 政务公开新闻
     */
    @Override
    public NewsNotice selectNewsNoticeById(Long id)
    {
        return newsNoticeMapper.selectNewsNoticeById(id);
    }

    /**
     * 查询政务公开新闻列表
     * 
     * @param newsNotice 政务公开新闻
     * @return 政务公开新闻
     */
    @Override
    public List<NewsNotice> selectNewsNoticeList(NewsNotice newsNotice)
    {
        return newsNoticeMapper.selectNewsNoticeList(newsNotice);
    }

    /**
     * 新增政务公开新闻
     * 
     * @param newsNotice 政务公开新闻
     * @return 结果
     */
    @Override
    public int insertNewsNotice(NewsNotice newsNotice)
    {
        newsNotice.setCreateTime(DateUtils.getNowDate());
        return newsNoticeMapper.insertNewsNotice(newsNotice);
    }

    /**
     * 修改政务公开新闻
     * 
     * @param newsNotice 政务公开新闻
     * @return 结果
     */
    @Override
    public int updateNewsNotice(NewsNotice newsNotice)
    {
        newsNotice.setUpdateTime(DateUtils.getNowDate());
        return newsNoticeMapper.updateNewsNotice(newsNotice);
    }

    /**
     * 批量删除政务公开新闻
     * 
     * @param ids 需要删除的政务公开新闻主键
     * @return 结果
     */
    @Override
    public int deleteNewsNoticeByIds(Long[] ids)
    {
        return newsNoticeMapper.deleteNewsNoticeByIds(ids);
    }

    /**
     * 删除政务公开新闻信息
     * 
     * @param id 政务公开新闻主键
     * @return 结果
     */
    @Override
    public int deleteNewsNoticeById(Long id)
    {
        return newsNoticeMapper.deleteNewsNoticeById(id);
    }
}
